import socket

# target_host = "www.deali.cn"
# target_port = 80

target_host = "127.0.0.1"
target_port = 9999

# create a socket object
client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)

# connect
client.connect((target_host, target_port))

# send some data
client.send("GET / HTTP/1.1\r\nHost: {}\r\n\r\n".format(target_host).encode('utf-8'))

# receive some data
response = client.recv(4096)

print(response)
